home *** CD-ROM | disk | FTP | other *** search
- function HistoryItem(html, type, searchString, searchParams) {
- this.htmlPage = html;
- this.searchType = type;
- this.searchString = searchString;
- this.globalSearchParams = searchParams;
- }
-
- function HistoryMag() {
- this.items = new Array();
- this.position = -1;
-
- this.deleteAllAfterCurrentPosition = function() {
- if (this.position != -1) {
- this.items.length = this.position+1;
- }
- else {
- this.items = new Array();
- }
- }
-
- this.insertItem = function(filename, type, searchString, searchParams) {
- var item = new HistoryItem(filename, type, searchString, searchParams);
- this.deleteAllAfterCurrentPosition();
- this.items.push(item);
- if (this.position == -1) {
- this.moveFirst();
- }
- else {
- this.position = this.items.length-1;
- }
- }
-
- this.getItem = function() {
- if (this.position != -1) {
- var item = this.items[this.position];
- return new Array(item.htmlPage, item.searchType, item.searchString, item.globalSearchParams);
- }
- else {
- return null;
- }
- }
-
- this.moveFirst = function() {
- if (this.items.length > 0) {
- this.position = 0;
- }
- }
-
- this.movePrev = function() {
- if (this.position > 0) {
- this.position--;
- }
- }
-
- this.moveNext = function() {
- if (this.position < this.items.length-1) {
- this.position++;
- }
- }
-
- }
-